package com.stone.serverless.web.domain;


import java.util.List;

/**
 * @Description: TODO
 * @Author: MECHREVO
 * @Date: 2022/1/21 10:52
 * @Version: 1.0.0
 */

public class ServerlessClassRequestMappingInfo {
    String[] paths;

    List<String> methods;

    String[] params;

    String[] headers;

    String[] consumes;

    String[] produces;

    String mappingName;

    Object handler;

    private List<ServerlessMethodRequestMappingInfo> methodRequestMappingInfoList;


    public String[] getPaths() {
        return paths;
    }

    public void setPaths(String[] paths) {
        this.paths = paths;
    }

    public List<String> getMethods() {
        return methods;
    }

    public void setMethods(List<String> methods) {
        this.methods = methods;
    }

    public String[] getParams() {
        return params;
    }

    public void setParams(String[] params) {
        this.params = params;
    }

    public String[] getHeaders() {
        return headers;
    }

    public void setHeaders(String[] headers) {
        this.headers = headers;
    }

    public String[] getConsumes() {
        return consumes;
    }

    public void setConsumes(String[] consumes) {
        this.consumes = consumes;
    }

    public String[] getProduces() {
        return produces;
    }

    public void setProduces(String[] produces) {
        this.produces = produces;
    }

    public String getMappingName() {
        return mappingName;
    }

    public void setMappingName(String mappingName) {
        this.mappingName = mappingName;
    }

    public Object getHandler() {
        return handler;
    }

    public void setHandler(Object handler) {
        this.handler = handler;
    }

    public List<ServerlessMethodRequestMappingInfo> getMethodRequestMappingInfoList() {
        return methodRequestMappingInfoList;
    }

    public void setMethodRequestMappingInfoList(List<ServerlessMethodRequestMappingInfo> methodRequestMappingInfoList) {
        this.methodRequestMappingInfoList = methodRequestMappingInfoList;
    }

    //public static void copy(Object source, Object target, Class<?> methodMapping) {
    //    ReflectUtil.setFieldValue(target, "paths", ReflectUtil.getFieldValue(source, "paths"));
    //    ReflectUtil.setFieldValue(target, "methods", ReflectUtil.getFieldValue(source, "methods"));
    //    ReflectUtil.setFieldValue(target, "params", ReflectUtil.getFieldValue(source, "params"));
    //    ReflectUtil.setFieldValue(target, "headers", ReflectUtil.getFieldValue(source, "headers"));
    //    ReflectUtil.setFieldValue(target, "consumes", ReflectUtil.getFieldValue(source, "consumes"));
    //    ReflectUtil.setFieldValue(target, "produces", ReflectUtil.getFieldValue(source, "produces"));
    //    ReflectUtil.setFieldValue(target, "mappingName", ReflectUtil.getFieldValue(source, "mappingName"));
    //    ReflectUtil.setFieldValue(target, "handler", ReflectUtil.getFieldValue(source, "handler"));
    //
    //    if (ObjectUtil.isNull(methodMapping)) {
    //        return;
    //    }
    //
    //    List sourceReq = (List) ReflectUtil.getFieldValue(source, "methodRequestMappingInfoList");
    //
    //    List targetReq = new ArrayList();
    //
    //    for (Object so : sourceReq) {
    //        Object o = ReflectUtil.newInstance(methodMapping);
    //        ServerlessMethodRequestMappingInfo.copy(so, o);
    //        targetReq.add(o);
    //    }
    //
    //
    //    ReflectUtil.setFieldValue(target, "methodRequestMappingInfoList",targetReq);
    //
    //}
}
